cd "$replication\code\"
clear mata 
set matsize 5000

****************************************************************************** Input variables ************************************************************
global cluster "sd_code"
global AS_infs `""""'
global AS_var "NA"
global sample "year!=."
global controls ""
global controlsXYFEs ""
global controlsXinfs ""
global omitted_year1=-1
global omitted_year2=-6
global min_year=-6
global max_year=5
global colour="no_graphs"

global int "elecXroad"
local inf1=substr("${int}",1,4)
local inf2=substr("${int}",6,.)
global  infs "`inf1' `inf2' ${int}"
global absorb "shrid_code i.s_code#i.year"


global depvar "fires_winter"
qui: do Z_Event_code.do
foreach inf in $infs {
	qui estimates restore main_regression
	lincom ${post_terms_`inf'}
}


global depvar "ln_burnt_winter"
qui: do Z_Event_code.do
foreach inf in $infs {
	qui estimates restore main_regression
	lincom ${post_terms_`inf'}
}

global depvar "icw_irrigation"
global sample "(canal_govt_share_2001+canal_pvt_share_2001+river_irr_share_2001+lake_irr_share_2001)/tot_irr_share>.5 &  (canal_govt_share_2001+canal_pvt_share_2001+river_irr_share_2001+lake_irr_share_2001)/tot_irr_share<1.5"
qui: do Z_Event_code.do
foreach inf in $infs {
	qui estimates restore main_regression
	lincom ${post_terms_`inf'}
}



global sample "bwd_cat<2"
qui: do Z_Event_code.do
foreach inf in $infs {
	qui estimates restore main_regression
	lincom ${post_terms_`inf'}
}
